import {Pipe, PipeTransform} from '@angular/core';

@Pipe({
    name: 'desc'
})
export class DescPipe implements PipeTransform {
    transform(value: string, args?: any): any {
        if (value.startsWith('<p>')) {
            value = value.substring(3);
        }
        value = value.replace(/^\n+/, '');
        value = value.replace(/\n/g, '<br>');
        return value;
    }

}
